package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysOverWorkMapper;
import com.ruoyi.system.domain.SysOverWork;
import com.ruoyi.system.service.ISysOverWorkService;
import com.ruoyi.common.core.text.Convert;

/**
 * 加班Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-24
 */
@Service
public class SysOverWorkServiceImpl implements ISysOverWorkService 
{
    @Autowired
    private SysOverWorkMapper sysOverWorkMapper;

    /**
     * 查询加班
     * 
     * @param overWorkId 加班ID
     * @return 加班
     */
    @Override
    public SysOverWork selectSysOverWorkById(Long overWorkId)
    {
        return sysOverWorkMapper.selectSysOverWorkById(overWorkId);
    }

    /**
     * 查询加班列表
     * 
     * @param sysOverWork 加班
     * @return 加班
     */
    @Override
    public List<SysOverWork> selectSysOverWorkList(SysOverWork sysOverWork)
    {
        return sysOverWorkMapper.selectSysOverWorkList(sysOverWork);
    }

    @Override
    public int approval(long overWorkId) {
        return sysOverWorkMapper.approval(overWorkId);
    }

    @Override
    public int leaderApproval(long leaveId) {
        return sysOverWorkMapper.leaderApproval(leaveId);
    }

    /**
     * 新增加班
     * 
     * @param sysOverWork 加班
     * @return 结果
     */
    @Override
    public int insertSysOverWork(SysOverWork sysOverWork)
    {
        return sysOverWorkMapper.insertSysOverWork(sysOverWork);
    }

    /**
     * 修改加班
     * 
     * @param sysOverWork 加班
     * @return 结果
     */
    @Override
    public int updateSysOverWork(SysOverWork sysOverWork)
    {
        return sysOverWorkMapper.updateSysOverWork(sysOverWork);
    }

    /**
     * 删除加班对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysOverWorkByIds(String ids)
    {
        return sysOverWorkMapper.deleteSysOverWorkByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除加班信息
     * 
     * @param overWorkId 加班ID
     * @return 结果
     */
    @Override
    public int deleteSysOverWorkById(Long overWorkId)
    {
        return sysOverWorkMapper.deleteSysOverWorkById(overWorkId);
    }
}
